/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package LaporanTransaksi;

import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author w7
 */
public class LaporanTableModel extends AbstractTableModel {

    private List<LaporanTransaksi> LT = new ArrayList<LaporanTransaksi>();
    Double saldoSesudah = 0.00;

    public LaporanTableModel(List<LaporanTransaksi> LT) {
        this.LT = LT;
    }

    public int getRowCount() {
        return LT.size();
    }

    public int getColumnCount() {
        return 8;
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        LaporanTransaksi kat = LT.get(rowIndex);
        switch (columnIndex) {
            case 0:
                return kat.getNoInvoice();
            case 1:
                return kat.getID_Anggota();
            case 2:
                return kat.getID_Unit();
            case 3:
                return kat.getTanggal();
            case 4:
                return kat.getKeterangan();
            case 5:
                return kat.getDanaMasuk();
            case 6:
                return kat.getDanaKeluar();
            case 7:
                return kat.getSaldo();
            default:
                return "";
        }
    }

    @Override
    public String getColumnName(int column) {
        switch (column) {
            case 0:
                return "NO INVOICE";
            case 1:
                return "ID ANGGOTA";
            case 2:
                return "ID UNIT";
            case 3:
                return "TANGGAL";
            case 4:
                return "KETERANGAN";
            case 5:
                return "DANA MASUK";
            case 6:
                return "DANA KELUAR";
            case 7:
                return "SALDO";
            default:
                return "";
        }
    }
}
